# Maintainer: Cían Hughes <Ci@nHugh.es>
pkgname=knxd
pkgver=0.14.59
pkgrel=0
pkgdesc="Knxd is an advanced KNX router/gateway; it can talk to all known KNX interfaces"
arch="all"
url="https://github.com/knxd/knxd"
license="GPL-2.0-only"
makedepends="
	argp-standalone
	autoconf
	automake
	bsd-compat-headers
	fmt-dev
	libev-dev
	libtool
	libusb-dev
	linux-headers
	m4
	"
subpackages="$pkgname-dev"
source="$pkgname-$pkgver.tar.gz::https://codeload.github.com/knxd/knxd/tar.gz/$pkgver
	$pkgname-$pkgver-fmt10.patch::https://github.com/knxd/knxd/commit/797283251470786bffd6586571407337da899d30.patch"
options="!check" # no tests

prepare() {
	default_prepare

	printf "#!/bin/sh\n\necho %s" "$pkgver" > ./tools/version.sh
	sh ./bootstrap.sh
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--disable-systemd
	make
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="
0ae842bf9d753cb793df486a76a4830b702bc3c1e9af12a8e6ba603a8b419b40ad711d4db73c5b581b15bbe938026c7ae28953fc0b18b485c64f72ff99996fda  knxd-0.14.59.tar.gz
9aae4a071272f1bf654a38d98d29879180df04caabf25f5e3a493d38ae4cf357c2d0b2acd7e328ebc4eddaaaeb92441ea79d696c6c86455087efa34c932acb35  knxd-0.14.59-fmt10.patch
"
